<script lang="ts" setup>
import GlobalHeader from "@/components/GlobalHeader.vue";
import GlobalSider from "@/components/GlobalSider.vue";
</script>

<template>
  <div class="basic-layout">
    <a-layout style="min-height: 100vh">
      <a-layout-header class="global-header">
        <div class="header-blur"></div>
        <GlobalHeader class="header-content"/>
      </a-layout-header>
<!--      侧边栏-->
<!--      <GlobalSider></GlobalSider>-->
      <a-layout-content class="main-content">
        <router-view v-slot="{ Component }">
          <transition name="fade-transform" mode="out-in">
            <component :is="Component" />
          </transition>
        </router-view>
      </a-layout-content>

      <a-layout-footer class="global-footer">
        <div class="footer-content">
          <div class="footer-links">
            <a target="_blank" href="https://gitee.com/wangfenghuan3399" class="footer-link">
              <span class="link-icon">👨💻</span>
              <span class="link-text">作者：@wangfenghuan</span>
            </a>
            <span class="divider">|</span>
            <a href="/privacy" class="footer-link">隐私政策</a>
            <span class="divider">|</span>
            <a href="/about" class="footer-link">关于我们</a>
          </div>
          <div class="copyright">
            © 2025 视觉创意平台 保留所有权利
          </div>
        </div>
      </a-layout-footer>
    </a-layout>
  </div>
</template>

<style scoped lang="less">
@primary-color: #6366f1;
@bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);

.basic-layout {
  background: @bg-gradient;
}

.global-header {
  position: fixed;
  top: 0;
  z-index: 1000;
  width: 100%;
  height: 64px;
  line-height: 64px;
  background: transparent !important;
  padding: 0 !important;
  transition: all 0.3s ease;

  .header-blur {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    mask-image: linear-gradient(
        to bottom,
        rgba(0,0,0,1) 80%,
        rgba(0,0,0,0) 100%
    );
  }

  .header-content {
    position: relative;
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 24px;
  }

  &:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    transform: translateY(1px);
  }
}

.main-content {
  margin-top: 64px;
  padding: 24px;
  min-height: calc(100vh - 128px);

  @media (max-width: 768px) {
    padding: 16px;
  }
}

.global-footer {
  background: linear-gradient(135deg, rgba(15,23,42,0.9) 0%, rgba(30,41,59,0.9) 100%) !important;
  backdrop-filter: blur(10px);
  color: #94a3b8 !important;
  padding: 24px 0 !important;
  border-top: 1px solid rgba(99,102,241,0.2);
  transition: all 0.3s ease;

  .footer-content {
    max-width: 1440px;
    margin: 0 auto;
    text-align: center;
  }

  .footer-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 12px;
  }

  .footer-link {
    color: #cbd5e1 !important;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;

    .link-icon {
      margin-right: 8px;
      filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
    }

    &:hover {
      color: @primary-color !important;
      transform: translateY(-1px);

      .link-text {
        text-shadow: 0 2px 8px rgba(99,102,241,0.3);
      }
    }
  }

  .divider {
    color: rgba(99,102,241,0.4);
  }

  .copyright {
    font-size: 0.9em;
    letter-spacing: 0.5px;
  }

  &:hover {
    transform: translateY(-2px);
    box-shadow: 0 -4px 20px rgba(99,102,241,0.1);
  }
}

.fade-transform-enter-active,
.fade-transform-leave-active {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-transform-enter-from,
.fade-transform-leave-to {
  opacity: 0;
  transform: translateY(10px);
}

@media (max-width: 768px) {
  .global-header {
    height: 56px;
    line-height: 56px;

    .header-content {
      padding: 0 16px;
    }
  }

  .main-content {
    margin-top: 56px;
  }

  .global-footer {
    padding: 16px 0 !important;

    .footer-links {
      gap: 12px;
    }
  }
}
</style>
